\(\int \frac {\cos ^4(c+d x)}{(a+i a \tan (c+d x))^3} \, dx\) [139]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [F(-2)]
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 24, antiderivative size = 195 \[ \int \frac {\cos ^4(c+d x)}{(a+i a \tan (c+d x))^3} \, dx=\frac {21 x}{128 a^3}-\frac {i}{128 a d (a-i a \tan (c+d x))^2}+\frac {i a^2}{40 d (a+i a \tan (c+d x))^5}+\frac {3 i a}{64 d (a+i a \tan (c+d x))^4}+\frac {i}{16 d (a+i a \tan (c+d x))^3}+\frac {5 i}{64 a d (a+i a \tan (c+d x))^2}-\frac {3 i}{64 d \left (a^3-i a^3 \tan (c+d x)\right )}+\frac {15 i}{128 d \left (a^3+i a^3 \tan (c+d x)\right )} \]

[Out]

21/128*x/a^3-1/128*I/a/d/(a-I*a*tan(d*x+c))^2+1/40*I*a^2/d/(a+I*a*tan(d*x+c))^5+3/64*I*a/d/(a+I*a*tan(d*x+c))^
4+1/16*I/d/(a+I*a*tan(d*x+c))^3+5/64*I/a/d/(a+I*a*tan(d*x+c))^2-3/64*I/d/(a^3-I*a^3*tan(d*x+c))+15/128*I/d/(a^
3+I*a^3*tan(d*x+c))

Rubi [A] (verified)

Time = 0.15 (sec) , antiderivative size = 195, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {3568, 46, 212} \[ \int \frac {\cos ^4(c+d x)}{(a+i a \tan (c+d x))^3} \, dx=-\frac {3 i}{64 d \left (a^3-i a^3 \tan (c+d x)\right )}+\frac {15 i}{128 d \left (a^3+i a^3 \tan (c+d x)\right )}+\frac {21 x}{128 a^3}+\frac {i a^2}{40 d (a+i a \tan (c+d x))^5}+\frac {3 i a}{64 d (a+i a \tan (c+d x))^4}+\frac {i}{16 d (a+i a \tan (c+d x))^3}-\frac {i}{128 a d (a-i a \tan (c+d x))^2}+\frac {5 i}{64 a d (a+i a \tan (c+d x))^2} \]

[In]

Int[Cos[c + d*x]^4/(a + I*a*Tan[c + d*x])^3,x]

[Out]

(21*x)/(128*a^3) - (I/128)/(a*d*(a - I*a*Tan[c + d*x])^2) + ((I/40)*a^2)/(d*(a + I*a*Tan[c + d*x])^5) + (((3*I
)/64)*a)/(d*(a + I*a*Tan[c + d*x])^4) + (I/16)/(d*(a + I*a*Tan[c + d*x])^3) + ((5*I)/64)/(a*d*(a + I*a*Tan[c +
 d*x])^2) - ((3*I)/64)/(d*(a^3 - I*a^3*Tan[c + d*x])) + ((15*I)/128)/(d*(a^3 + I*a^3*Tan[c + d*x]))

Rule 46

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x
)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && Lt
Q[m + n + 2, 0])

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 3568

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rubi steps \begin{align*} \text {integral}& = -\frac {\left (i a^5\right ) \text {Subst}\left (\int \frac {1}{(a-x)^3 (a+x)^6} \, dx,x,i a \tan (c+d x)\right )}{d} \\ & = -\frac {\left (i a^5\right ) \text {Subst}\left (\int \left (\frac {1}{64 a^6 (a-x)^3}+\frac {3}{64 a^7 (a-x)^2}+\frac {1}{8 a^3 (a+x)^6}+\frac {3}{16 a^4 (a+x)^5}+\frac {3}{16 a^5 (a+x)^4}+\frac {5}{32 a^6 (a+x)^3}+\frac {15}{128 a^7 (a+x)^2}+\frac {21}{128 a^7 \left (a^2-x^2\right )}\right ) \, dx,x,i a \tan (c+d x)\right )}{d} \\ & = -\frac {i}{128 a d (a-i a \tan (c+d x))^2}+\frac {i a^2}{40 d (a+i a \tan (c+d x))^5}+\frac {3 i a}{64 d (a+i a \tan (c+d x))^4}+\frac {i}{16 d (a+i a \tan (c+d x))^3}+\frac {5 i}{64 a d (a+i a \tan (c+d x))^2}-\frac {3 i}{64 d \left (a^3-i a^3 \tan (c+d x)\right )}+\frac {15 i}{128 d \left (a^3+i a^3 \tan (c+d x)\right )}-\frac {(21 i) \text {Subst}\left (\int \frac {1}{a^2-x^2} \, dx,x,i a \tan (c+d x)\right )}{128 a^2 d} \\ & = \frac {21 x}{128 a^3}-\frac {i}{128 a d (a-i a \tan (c+d x))^2}+\frac {i a^2}{40 d (a+i a \tan (c+d x))^5}+\frac {3 i a}{64 d (a+i a \tan (c+d x))^4}+\frac {i}{16 d (a+i a \tan (c+d x))^3}+\frac {5 i}{64 a d (a+i a \tan (c+d x))^2}-\frac {3 i}{64 d \left (a^3-i a^3 \tan (c+d x)\right )}+\frac {15 i}{128 d \left (a^3+i a^3 \tan (c+d x)\right )} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.37 (sec) , antiderivative size = 159, normalized size of antiderivative = 0.82 \[ \int \frac {\cos ^4(c+d x)}{(a+i a \tan (c+d x))^3} \, dx=\frac {\sec ^7(c+d x) (-1050 \cos (c+d x)-469 \cos (3 (c+d x))+105 \cos (5 (c+d x))+6 \cos (7 (c+d x))-350 i \sin (c+d x)+840 i \arctan (\tan (c+d x)) (\cos (3 (c+d x))+i \sin (3 (c+d x)))-189 i \sin (3 (c+d x))+175 i \sin (5 (c+d x))+14 i \sin (7 (c+d x)))}{5120 a^3 d (-i+\tan (c+d x))^5 (i+\tan (c+d x))^2} \]

[In]

Integrate[Cos[c + d*x]^4/(a + I*a*Tan[c + d*x])^3,x]

[Out]

(Sec[c + d*x]^7*(-1050*Cos[c + d*x] - 469*Cos[3*(c + d*x)] + 105*Cos[5*(c + d*x)] + 6*Cos[7*(c + d*x)] - (350*
I)*Sin[c + d*x] + (840*I)*ArcTan[Tan[c + d*x]]*(Cos[3*(c + d*x)] + I*Sin[3*(c + d*x)]) - (189*I)*Sin[3*(c + d*
x)] + (175*I)*Sin[5*(c + d*x)] + (14*I)*Sin[7*(c + d*x)]))/(5120*a^3*d*(-I + Tan[c + d*x])^5*(I + Tan[c + d*x]
)^2)

Maple [A] (verified)

Time = 0.76 (sec) , antiderivative size = 129, normalized size of antiderivative = 0.66

method result size
derivativedivides \(\frac {-\frac {21 i \ln \left (\tan \left (d x +c \right )-i\right )}{256}+\frac {3 i}{64 \left (\tan \left (d x +c \right )-i\right )^{4}}-\frac {5 i}{64 \left (\tan \left (d x +c \right )-i\right )^{2}}+\frac {1}{40 \left (\tan \left (d x +c \right )-i\right )^{5}}-\frac {1}{16 \left (\tan \left (d x +c \right )-i\right )^{3}}+\frac {15}{128 \left (\tan \left (d x +c \right )-i\right )}+\frac {i}{128 \left (\tan \left (d x +c \right )+i\right )^{2}}+\frac {21 i \ln \left (\tan \left (d x +c \right )+i\right )}{256}+\frac {3}{64 \left (\tan \left (d x +c \right )+i\right )}}{d \,a^{3}}\) \(129\)
default \(\frac {-\frac {21 i \ln \left (\tan \left (d x +c \right )-i\right )}{256}+\frac {3 i}{64 \left (\tan \left (d x +c \right )-i\right )^{4}}-\frac {5 i}{64 \left (\tan \left (d x +c \right )-i\right )^{2}}+\frac {1}{40 \left (\tan \left (d x +c \right )-i\right )^{5}}-\frac {1}{16 \left (\tan \left (d x +c \right )-i\right )^{3}}+\frac {15}{128 \left (\tan \left (d x +c \right )-i\right )}+\frac {i}{128 \left (\tan \left (d x +c \right )+i\right )^{2}}+\frac {21 i \ln \left (\tan \left (d x +c \right )+i\right )}{256}+\frac {3}{64 \left (\tan \left (d x +c \right )+i\right )}}{d \,a^{3}}\) \(129\)
risch \(\frac {21 x}{128 a^{3}}+\frac {7 i {\mathrm e}^{-6 i \left (d x +c \right )}}{256 a^{3} d}+\frac {7 i {\mathrm e}^{-8 i \left (d x +c \right )}}{1024 a^{3} d}+\frac {i {\mathrm e}^{-10 i \left (d x +c \right )}}{1280 a^{3} d}+\frac {17 i \cos \left (4 d x +4 c \right )}{256 a^{3} d}+\frac {9 \sin \left (4 d x +4 c \right )}{128 a^{3} d}+\frac {7 i \cos \left (2 d x +2 c \right )}{64 a^{3} d}+\frac {21 \sin \left (2 d x +2 c \right )}{128 a^{3} d}\) \(132\)

[In]

int(cos(d*x+c)^4/(a+I*a*tan(d*x+c))^3,x,method=_RETURNVERBOSE)

[Out]

1/d/a^3*(-21/256*I*ln(tan(d*x+c)-I)+3/64*I/(tan(d*x+c)-I)^4-5/64*I/(tan(d*x+c)-I)^2+1/40/(tan(d*x+c)-I)^5-1/16
/(tan(d*x+c)-I)^3+15/128/(tan(d*x+c)-I)+1/128*I/(tan(d*x+c)+I)^2+21/256*I*ln(tan(d*x+c)+I)+3/64/(tan(d*x+c)+I)
)

Fricas [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 98, normalized size of antiderivative = 0.50 \[ \int \frac {\cos ^4(c+d x)}{(a+i a \tan (c+d x))^3} \, dx=\frac {{\left (840 \, d x e^{\left (10 i \, d x + 10 i \, c\right )} - 10 i \, e^{\left (14 i \, d x + 14 i \, c\right )} - 140 i \, e^{\left (12 i \, d x + 12 i \, c\right )} + 700 i \, e^{\left (8 i \, d x + 8 i \, c\right )} + 350 i \, e^{\left (6 i \, d x + 6 i \, c\right )} + 140 i \, e^{\left (4 i \, d x + 4 i \, c\right )} + 35 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + 4 i\right )} e^{\left (-10 i \, d x - 10 i \, c\right )}}{5120 \, a^{3} d} \]

[In]

integrate(cos(d*x+c)^4/(a+I*a*tan(d*x+c))^3,x, algorithm="fricas")

[Out]

1/5120*(840*d*x*e^(10*I*d*x + 10*I*c) - 10*I*e^(14*I*d*x + 14*I*c) - 140*I*e^(12*I*d*x + 12*I*c) + 700*I*e^(8*
I*d*x + 8*I*c) + 350*I*e^(6*I*d*x + 6*I*c) + 140*I*e^(4*I*d*x + 4*I*c) + 35*I*e^(2*I*d*x + 2*I*c) + 4*I)*e^(-1
0*I*d*x - 10*I*c)/(a^3*d)

Sympy [A] (verification not implemented)

Time = 0.31 (sec) , antiderivative size = 292, normalized size of antiderivative = 1.50 \[ \int \frac {\cos ^4(c+d x)}{(a+i a \tan (c+d x))^3} \, dx=\begin {cases} \frac {\left (- 11258999068426240 i a^{18} d^{6} e^{34 i c} e^{4 i d x} - 157625986957967360 i a^{18} d^{6} e^{32 i c} e^{2 i d x} + 788129934789836800 i a^{18} d^{6} e^{28 i c} e^{- 2 i d x} + 394064967394918400 i a^{18} d^{6} e^{26 i c} e^{- 4 i d x} + 157625986957967360 i a^{18} d^{6} e^{24 i c} e^{- 6 i d x} + 39406496739491840 i a^{18} d^{6} e^{22 i c} e^{- 8 i d x} + 4503599627370496 i a^{18} d^{6} e^{20 i c} e^{- 10 i d x}\right ) e^{- 30 i c}}{5764607523034234880 a^{21} d^{7}} & \text {for}\: a^{21} d^{7} e^{30 i c} \neq 0 \\x \left (\frac {\left (e^{14 i c} + 7 e^{12 i c} + 21 e^{10 i c} + 35 e^{8 i c} + 35 e^{6 i c} + 21 e^{4 i c} + 7 e^{2 i c} + 1\right ) e^{- 10 i c}}{128 a^{3}} - \frac {21}{128 a^{3}}\right ) & \text {otherwise} \end {cases} + \frac {21 x}{128 a^{3}} \]

[In]

integrate(cos(d*x+c)**4/(a+I*a*tan(d*x+c))**3,x)

[Out]

Piecewise(((-11258999068426240*I*a**18*d**6*exp(34*I*c)*exp(4*I*d*x) - 157625986957967360*I*a**18*d**6*exp(32*
I*c)*exp(2*I*d*x) + 788129934789836800*I*a**18*d**6*exp(28*I*c)*exp(-2*I*d*x) + 394064967394918400*I*a**18*d**
6*exp(26*I*c)*exp(-4*I*d*x) + 157625986957967360*I*a**18*d**6*exp(24*I*c)*exp(-6*I*d*x) + 39406496739491840*I*
a**18*d**6*exp(22*I*c)*exp(-8*I*d*x) + 4503599627370496*I*a**18*d**6*exp(20*I*c)*exp(-10*I*d*x))*exp(-30*I*c)/
(5764607523034234880*a**21*d**7), Ne(a**21*d**7*exp(30*I*c), 0)), (x*((exp(14*I*c) + 7*exp(12*I*c) + 21*exp(10
*I*c) + 35*exp(8*I*c) + 35*exp(6*I*c) + 21*exp(4*I*c) + 7*exp(2*I*c) + 1)*exp(-10*I*c)/(128*a**3) - 21/(128*a*
*3)), True)) + 21*x/(128*a**3)

Maxima [F(-2)]

Exception generated. \[ \int \frac {\cos ^4(c+d x)}{(a+i a \tan (c+d x))^3} \, dx=\text {Exception raised: RuntimeError} \]

[In]

integrate(cos(d*x+c)^4/(a+I*a*tan(d*x+c))^3,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: expt: undefined: 0 to a negative exponent.

Giac [A] (verification not implemented)

none

Time = 0.68 (sec) , antiderivative size = 136, normalized size of antiderivative = 0.70 \[ \int \frac {\cos ^4(c+d x)}{(a+i a \tan (c+d x))^3} \, dx=-\frac {-\frac {420 i \, \log \left (\tan \left (d x + c\right ) + i\right )}{a^{3}} + \frac {420 i \, \log \left (\tan \left (d x + c\right ) - i\right )}{a^{3}} + \frac {10 \, {\left (-63 i \, \tan \left (d x + c\right )^{2} + 150 \, \tan \left (d x + c\right ) + 91 i\right )}}{a^{3} {\left (i \, \tan \left (d x + c\right ) - 1\right )}^{2}} - \frac {959 i \, \tan \left (d x + c\right )^{5} + 5395 \, \tan \left (d x + c\right )^{4} - 12390 i \, \tan \left (d x + c\right )^{3} - 14710 \, \tan \left (d x + c\right )^{2} + 9275 i \, \tan \left (d x + c\right ) + 2647}{a^{3} {\left (\tan \left (d x + c\right ) - i\right )}^{5}}}{5120 \, d} \]

[In]

integrate(cos(d*x+c)^4/(a+I*a*tan(d*x+c))^3,x, algorithm="giac")

[Out]

-1/5120*(-420*I*log(tan(d*x + c) + I)/a^3 + 420*I*log(tan(d*x + c) - I)/a^3 + 10*(-63*I*tan(d*x + c)^2 + 150*t
an(d*x + c) + 91*I)/(a^3*(I*tan(d*x + c) - 1)^2) - (959*I*tan(d*x + c)^5 + 5395*tan(d*x + c)^4 - 12390*I*tan(d
*x + c)^3 - 14710*tan(d*x + c)^2 + 9275*I*tan(d*x + c) + 2647)/(a^3*(tan(d*x + c) - I)^5))/d

Mupad [B] (verification not implemented)

Time = 5.63 (sec) , antiderivative size = 173, normalized size of antiderivative = 0.89 \[ \int \frac {\cos ^4(c+d x)}{(a+i a \tan (c+d x))^3} \, dx=\frac {21\,x}{128\,a^3}+\frac {\frac {7\,\mathrm {tan}\left (c+d\,x\right )}{640\,a^3}+\frac {11{}\mathrm {i}}{40\,a^3}+\frac {{\mathrm {tan}\left (c+d\,x\right )}^2\,469{}\mathrm {i}}{640\,a^3}-\frac {21\,{\mathrm {tan}\left (c+d\,x\right )}^3}{32\,a^3}+\frac {{\mathrm {tan}\left (c+d\,x\right )}^4\,7{}\mathrm {i}}{32\,a^3}-\frac {63\,{\mathrm {tan}\left (c+d\,x\right )}^5}{128\,a^3}-\frac {{\mathrm {tan}\left (c+d\,x\right )}^6\,21{}\mathrm {i}}{128\,a^3}}{d\,\left (-{\mathrm {tan}\left (c+d\,x\right )}^7\,1{}\mathrm {i}-3\,{\mathrm {tan}\left (c+d\,x\right )}^6+{\mathrm {tan}\left (c+d\,x\right )}^5\,1{}\mathrm {i}-5\,{\mathrm {tan}\left (c+d\,x\right )}^4+{\mathrm {tan}\left (c+d\,x\right )}^3\,5{}\mathrm {i}-{\mathrm {tan}\left (c+d\,x\right )}^2+\mathrm {tan}\left (c+d\,x\right )\,3{}\mathrm {i}+1\right )} \]

[In]

int(cos(c + d*x)^4/(a + a*tan(c + d*x)*1i)^3,x)

[Out]

(21*x)/(128*a^3) + ((7*tan(c + d*x))/(640*a^3) + 11i/(40*a^3) + (tan(c + d*x)^2*469i)/(640*a^3) - (21*tan(c +
d*x)^3)/(32*a^3) + (tan(c + d*x)^4*7i)/(32*a^3) - (63*tan(c + d*x)^5)/(128*a^3) - (tan(c + d*x)^6*21i)/(128*a^
3))/(d*(tan(c + d*x)*3i - tan(c + d*x)^2 + tan(c + d*x)^3*5i - 5*tan(c + d*x)^4 + tan(c + d*x)^5*1i - 3*tan(c
+ d*x)^6 - tan(c + d*x)^7*1i + 1))